﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>if...else if....else语句</title>
</head>
<body>
    <script>
        let d = new Date();
        let time = d.getHours();
        if (time < 10) {
            document.write("<b>早上好！</b>");
        } else if (time >= 10 && time < 16) {
            document.write("<b>下午好！</b>");
        } else {
            document.write("<b>晚上好！</b>");
        }
    </script>
    <p>

    </p>
</body>
</html>